import { Base } from '../../utils/base.js';
class Model extends Base {
  constructor() {
    super();
  }

  // 获取收入
  getEarnings(callback){
    this.request({
      url: '/get_earnings',
      success: function (res) {
        callback && callback(res)
      },
      fail: function (res) {
        callback && callback(res)
      }
    })
  }

  // 获取银行卡信息
  getUserBank(callback) {
    this.request({
      url: '/get_user_bank',
      success: function (res) {
        callback && callback(res)
      },
      fail: function (res) {
        callback && callback(res)
      }
    })
  }

  // 申请提现
  setEarningsDrawing(data,callback){
    this.request({
      url: '/earnings_drawing',
      type: 'POST',
      data: data,
      success: function (res) {
        callback && callback(res)
      },
      fail: function (res) {
        callback && callback(res)
      }
    })
  }

  // 获取积分记录
  getRecords(callback) {
    this.request({
      url: '/get_earnings_records',
      success: function (res) {
        callback && callback(res)
      }
    })
  }

  // 提现记录
  getEarningsDrawing(callback){
    this.request({
      url: '/get_earnings_drawing',
      success: function (res) {
        callback && callback(res)
      }
    })
  }
}
export { Model }